#include <stdio.h>
const int N = 110;
int a[N];
int b[N];
int main()
{
	int i = 0;
	while (scanf("%d", &a[i]) == 1)
	{
		i++;
	}
	int m = a[i - 1];
	int n = i - 1;
	for (int i = 0; i < n; i++)
	{
		b[(i + m) % n] = a[i];
	}
	for (int i = 0; i < n; i++)
	{
		printf("%d ", b[i]);
	}
	return 0;
}
